Skip to content

Fix mobile menu scrolling the page behind it - #84

Merged
StreamSeb merged 1 commit into
mainfrom
claude/project-thread-iikzc0
Nov 16, 2026
Merged

StreamSeb merged 1 commit into
mainfrom
claude/project-thread-iikzc0

Conversation

@StreamSeb

Copy link
Copy Markdown
Owner

Requested by Seb · project thread

Problem

On phones, swiping in the open mobile menu scrolled the page behind it. The menu lives in the sticky header with no height limit, so a long menu ran off the bottom of the screen and could never be scrolled on its own.

Fix (src/components/layout/header.tsx only)

  • The menu panel is capped at 100dvh minus the header height and scrolls internally (overflow-y-auto), with overscroll-contain so reaching its top or bottom doesn't chain to the page.
  • While the menu is open, <html> gets overflow: hidden, which locks the page (iOS Safari 16+ honours this). <body> is deliberately left alone: setting it too turns <body> into its own scroll container and the sticky header jumps off-screen.
  • The lock is released when the menu closes, on unmount, and if the viewport grows past the lg breakpoint while open.
  • The toggle button gets aria-label, aria-expanded and aria-controls.

Checked

  • Emulated iPhone 13 in Chromium against the dev server: with the page scrolled down and the menu open, wheel/scroll input moved the menu to its end while the page's scroll position stayed put; closing the menu restored normal page scrolling and the header stayed pinned.
  • eslint clean on the changed file.
  • Not tested on a real iPhone; worth a quick swipe on the Vercel preview.

🤖 Generated with Claude Code

The mobile menu sat in the sticky header with no height limit, so on a
phone a long menu ran off the bottom of the screen and swiping scrolled
the page behind it instead.

The menu is now capped at the viewport height below the header and
scrolls on its own, with overscroll-contain so the scroll doesn't chain
to the page. While it is open, <html> gets overflow: hidden, which stops
the page scrolling (including on iOS Safari) without breaking the sticky
header. The lock is released when the menu closes or the viewport grows
past the lg breakpoint. The toggle button also gets an aria-label and
aria-expanded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StreamSeb StreamSeb self-assigned this Nov 16, 2026
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tunetapper Ready Ready Preview Nov 16, 2026 11:01am UTC

@StreamSeb
StreamSeb merged commit 408ab67 into main Nov 16, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Preview — 454fe02a Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant